Change in openvpn[master]: Implement multiline responses for pkcs11-id commands
A message that is not in the archive (sent off-list or not yet received): gerrit.1794059437000.I09e55085cde6dbc0040e111a42128527d59832b8@gerrit.openvpn.net
Attention is currently required from: Arne Schwabe.
Hello Arne Schwabe,
I'd like you to do a code review.
Please visit
https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
to review the following change.
Change subject: Implement multiline responses for pkcs11-id commands
......................................................................
Implement multiline responses for pkcs11-id commands
Responses to the management interface commands pkcs11-id-[get|count] did not follow the standard syntax, but instead looked like notifications.
Introduce a new management interface version to rewrite both commands to conform to the common multiline + END syntax. At the same time it is now possible to query all PKCS#11 ids using "all" or a range from "start" to "end" - 1. Failures to retrieve an id will return a partial response terminated by an "ERROR" message including the erroneous index.
The response format was changed to comma separated (index,id,cert_blob) which is easier to parse.
---
M doc/management-notes.txt
M src/openvpn/manage.c
M src/openvpn/manage.h
3 files changed, 167 insertions(+), 30 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/48/2148/1
doc/management-notes.txt +71 -3
@@ -619,21 +619,89 @@ Retrieve available number of certificates. -Example: +Example for client version < 7: pkcs11-id-count >PKCS11ID-COUNT:5 +Example for client version >= 7: + + pkcs11-id-count + 5 + END + COMMAND -- pkcs11-id-get (OpenVPN 2.1 or higher) ------------------------------------------------- + pkcs11-id-get <index> + Retrieve certificate by index, the ID string should be provided as PKCS#11 identity, the blob is a base 64 encoded certificate. -Example: +Example for client version < 7: pkcs11-id-get 1 - PKCS11ID-ENTRY:'1', ID:'<snip>', BLOB:'<snip>' + >PKCS11ID-ENTRY:'1', ID:'<snip>', BLOB:'<snip>' + +For client versions >= 7 it is also possible to retrieve multiple +PKCS#11 identities from index <start> to <end>-1. Alternatively +<start> = "all" retrieves all PKCS#11 identities. A comma separated +list including index, PKCS#11 id and the base 64 encoded certificate +will be returned. If any id retrieval results in a failure, the returned +list will be partial and terminated by "ERROR: .." instead of "END". +The "ERROR" message will include the index of failure. + + pkcs11-id-get <index> + pkcs11-id-get <start> <end> + pkcs11-id-get all + +Example 1: + + Management interface client sends: + + pkcs11-id-get 1 + + OpenVPN daemon responds with: + + 1,<id>,<blob> + END + +Example 2: + + Management interface client sends: + + pkcs11-id-get 1 3 + + OpenVPN daemon responds with: + + 1,<id_a>,<blob_a> + 2,<id_b>,<blob_b> + END + +Example 3: + + Management interface client sends: + + pkcs11-id-get all + + OpenVPN daemon with 3 PKCS#11 identities responds with: + + 0,<id_a>,<blob_a> + 1,<id_b>,<blob_b> + 2,<id_c>,<blob_c> + END + +Example 4: + + Management interface client sends: + + pkcs11-id-get all + + OpenVPN daemon with 3 PKCS#11 identities fails to retrieve index 1 + + 0,<id_a>,<blob_a> + ERROR: Failed to load PKCS#11 id at index: 1 + COMMAND -- client-auth (OpenVPN 2.1 or higher) -----------------------------------------------
src/openvpn/manage.c +95 -26
164 lines not on this page · raw message
src/openvpn/manage.h +1 -1
@@ -50,7 +50,7 @@#include "socket_util.h" #include "mroute.h" -#define MANAGEMENT_VERSION 6 +#define MANAGEMENT_VERSION 7#define MANAGEMENT_N_PASSWORD_RETRIES 3#define MANAGEMENT_LOG_HISTORY_INITIAL_SIZE 100#define MANAGEMENT_ECHO_BUFFER_SIZE 100
--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 1
Gerrit-Owner: Name of user not set #1000067
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Arne Schwabe <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Attention is currently required from: Arne Schwabe, [email protected].
Selva Nair has posted comments on this change by [email protected]. ( https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email )
Change subject: Implement multiline responses for pkcs11-id commands
......................................................................
Patch Set 1: Code-Review-1
(4 comments)
Patchset:
PS1:
Apart from comments below, in management-notes.txt, under OUTPUT_FORMAT no. (2), we say 'the last line will be "END"'. Add 'or "ERROR"' to it.
File doc/management-notes.txt:
https://gerrit.openvpn.net/c/openvpn/+/2148/comment/5cc4461f_a8ffdb34?usp=email :
PS1, Line 631: END
Describe the protocol in the both cases separately from examples? Like:
For management client versions < 7:
pkcs11-id-count
The reply is ">PKCS11ID-COUNT:<count>".
Example:
pkcs11-id-count
\>PKCS11ID-COUNT:5
For management client versions >= 7:
pkcs11-id-count
The reply is a decimal count followed by "END" on a line of its own.
Example:
pkcs11-id-count
5
END
https://gerrit.openvpn.net/c/openvpn/+/2148/comment/c76c252a_87366f38?usp=email :
PS1, Line 641: Example for client version < 7:
This section is confusing. Separate client version < 7 and >= 7 cleanly and provide protocol description separately from examples?
For management client versions < 7:
pkcs11-id-get <index>
.. desccribe legacy reply format.
Example:
...
For management client versions >= 7:
pkcs11-id-get <index>
pkcs11-id-get <start> <end>
pkcs11-id-get all
...index/range semantics, record format, END/ERROR termination...
Examples:
...
Also no need to retain the original '<snip>' as that's not how other examples are written. ID:'<id>', BLOB:'<blob>' is better.
File src/openvpn/manage.c:
https://gerrit.openvpn.net/c/openvpn/+/2148/comment/049a071a_702e63d8?usp=email :
PS1, Line 918:
Two helpers split a small parsing operation, interpret the start argument twice, and mix parsing with bounds clamping. A poor abstraction. I don’t see sufficient maintenance benefit from this. Better to leave remote-entry-get unchanged and use similar parsing logic here.
A better range parsing and validation could be a follow up.
--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 1
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: [email protected]
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Comment-Date: Sat, 07 Nov 2026 17:10:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Attention is currently required from: Arne Schwabe, Selva Nair, [email protected].
Hello Arne Schwabe, Selva Nair,
I'd like you to reexamine a change. Please visit
https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Code-Review-1 by Selva Nair
Change subject: Implement multiline responses for pkcs11-id commands
......................................................................
Implement multiline responses for pkcs11-id commands
Responses to the management interface commands pkcs11-id-[get|count] did not follow the standard syntax, but instead looked like notifications.
Introduce a new management interface version to rewrite both commands to conform to the common multiline + END syntax. At the same time it is now possible to query all PKCS#11 ids using "all" or a range from "start" to "end" - 1. Failures to retrieve an id will return a partial response terminated by an "ERROR" message including the erroneous index.
The response format was changed to comma separated (index,id,cert_blob) which is easier to parse.
---
M doc/management-notes.txt
M src/openvpn/manage.c
M src/openvpn/manage.h
3 files changed, 164 insertions(+), 21 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/48/2148/2
doc/management-notes.txt +89 -3
@@ -617,23 +617,109 @@ COMMAND -- pkcs11-id-count (OpenVPN 2.1 or higher) --------------------------------------------------- -Retrieve available number of certificates. +Retrieve available number of PKCS#11 certificates. + +For management client versions <7: + + pkcs11-id-count + +The reply is ">PKCS11ID-COUNT:<count>". Example: pkcs11-id-count >PKCS11ID-COUNT:5 +For management client versions >= 7: + + pkcs11-id-count + +The reply is a decimal count followed by "END" on a separate line. + +Example: + + pkcs11-id-count + 5 + END + COMMAND -- pkcs11-id-get (OpenVPN 2.1 or higher) ------------------------------------------------- +Retrieve PKCS#11 certificates. + +For management client versions < 7: + + pkcs11-id-get <index> + Retrieve certificate by index, the ID string should be provided as PKCS#11 identity, the blob is a base 64 encoded certificate. Example: pkcs11-id-get 1 - PKCS11ID-ENTRY:'1', ID:'<snip>', BLOB:'<snip>' + >PKCS11ID-ENTRY:'1', ID:'<id>', BLOB:'<blob>' + +For management client versions >= 7: + + pkcs11-id-get <index> + pkcs11-id-get <start> <end> + pkcs11-id-get all + +Retrieve a single PKCS#11 certificate at index <index> or multiple +PKCS#11 certificates from index <start> to <end>-1. Alternatively +<start> = "all" retrieves all PKCS#11 certificates. A comma separated +list including index, PKCS#11 id and the base 64 encoded certificate +will be returned. If any id retrieval results in a failure, the returned +list will be partial and terminated by "ERROR: .." instead of "END". +The "ERROR" message will include the index of failure. + +Example 1: + + Management interface client sends: + + pkcs11-id-get 1 + + OpenVPN daemon responds with: + + 1,<id>,<blob> + END + +Example 2: + + Management interface client sends: + + pkcs11-id-get 1 3 + + OpenVPN daemon responds with: + + 1,<id_a>,<blob_a> + 2,<id_b>,<blob_b> + END + +Example 3: + + Management interface client sends: + + pkcs11-id-get all + + OpenVPN daemon with 3 PKCS#11 certificates responds with: + + 0,<id_a>,<blob_a> + 1,<id_b>,<blob_b> + 2,<id_c>,<blob_c> + END + +Example 4: + + Management interface client sends: + + pkcs11-id-get all + + OpenVPN daemon with 3 PKCS#11 certificates fails to retrieve index 1 + + 0,<id_a>,<blob_a> + ERROR: Failed to load PKCS#11 id at index: 1 + COMMAND -- client-auth (OpenVPN 2.1 or higher) -----------------------------------------------
@@ -1240,7 +1326,7 @@ "ERROR: [text]". (2) For commands which print multiple lines of output, - the last line will be "END". + the last line will be "END" or "ERROR: [text]". (3) Real-time messages will be in the form ">[source]:[text]", where source is "CLIENT", "ECHO", "FATAL", "HOLD", "INFO", "LOG",
src/openvpn/manage.c +74 -17
122 lines not on this page · raw message
src/openvpn/manage.h +1 -1
@@ -50,7 +50,7 @@#include "socket_util.h" #include "mroute.h" -#define MANAGEMENT_VERSION 6 +#define MANAGEMENT_VERSION 7#define MANAGEMENT_N_PASSWORD_RETRIES 3#define MANAGEMENT_LOG_HISTORY_INITIAL_SIZE 100#define MANAGEMENT_ECHO_BUFFER_SIZE 100
--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 2
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Selva Nair <[email protected]>
Gerrit-Attention: [email protected]
Gerrit-Attention: Arne Schwabe <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Attention is currently required from: Arne Schwabe, [email protected].
Selva Nair has posted comments on this change by [email protected]. ( https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email )
Change subject: Implement multiline responses for pkcs11-id commands
......................................................................
Patch Set 2:
(5 comments)
Patchset:
PS1:
Quoted 1 line
Apart from comments below, in management-notes.txt, under
OUTPUT_FORMATno. […]
Done
Patchset:
PS2:
I tried re-pushing this to trigger the Buildbot runs, but got:
error: remote unpack failed: error Missing tree f6bb98471e275a4c88b6e8d969015945b6cebff5
Does anyone know how to resolve this?
The patch looks good now. The commit message mentions the new management version, but could you make the compatibility behavior explicit: the new command forms and response format apply only to clients announcing version >= 7; older clients retain the existing behavior. Sorry I missed this in the earlier review.
File doc/management-notes.txt:
https://gerrit.openvpn.net/c/openvpn/+/2148/comment/5fdea454_4e3a2211?usp=email :
PS1, Line 631: END
Quoted 1 line
Describe the protocol in the both cases separately from examples? Like: […]
Done
https://gerrit.openvpn.net/c/openvpn/+/2148/comment/8366e0e0_e327e8ff?usp=email :
PS1, Line 641: Example for client version < 7:
Quoted 1 line
This section is confusing. […]
Done
File src/openvpn/manage.c:
https://gerrit.openvpn.net/c/openvpn/+/2148/comment/1392ebf8_0d4fbd3f?usp=email :
PS1, Line 918:
Quoted 1 line
Two helpers split a small parsing operation, interpret the start argument twice, and mix parsing wit […]
Done
--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 2
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: [email protected]
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Comment-Date: Sun, 08 Nov 2026 16:10:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Selva Nair <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Attention is currently required from: Arne Schwabe, Frank Lichtenheld, [email protected].
Gert Doering has posted comments on this change by [email protected]. ( https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email )
Change subject: Implement multiline responses for pkcs11-id commands
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS2:
Quoted 1 line
I tried re-pushing this to trigger the Buildbot runs, but got: […]
I have seen this "Missing tree" message on a different patch, which made no sense whatsoever (pushing a v2 from the very same tree, same parent commit). I'd just retry and if it does not work complain to @[email protected] tomorrow
--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 2
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: Frank Lichtenheld <[email protected]>
Gerrit-CC: Gert Doering <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: [email protected]
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Attention: Frank Lichtenheld <[email protected]>
Gerrit-Comment-Date: Sun, 08 Nov 2026 16:12:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Selva Nair <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Attention is currently required from: Arne Schwabe, Frank Lichtenheld, [email protected].
Selva Nair has posted comments on this change by [email protected]. ( https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email )
Change subject: Implement multiline responses for pkcs11-id commands
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS2:
Quoted 1 line
I have seen this "Missing tree" message on a different patch, which made no sense whatsoever (pushin […]
Tried with a fresh clone of gerrit and the tree error is gone, but:
! [remote rejected] HEAD -> refs/for/master (cannot add patch set to 2148.)
error: failed to push some refs to 'ssh://gerrit.openvpn.net:29418/openvpn.git'
May be I no longer have permission to amend someone else's patchset or I forgot how to do this correctly.
--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 2
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: Frank Lichtenheld <[email protected]>
Gerrit-CC: Gert Doering <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: [email protected]
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Attention: Frank Lichtenheld <[email protected]>
Gerrit-Comment-Date: Sun, 08 Nov 2026 17:08:18 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Selva Nair <[email protected]>
Comment-In-Reply-To: Gert Doering <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Attention is currently required from: Arne Schwabe, Frank Lichtenheld, [email protected].
Hello Arne Schwabe, Selva Nair,
I'd like you to reexamine a change. Please visit
https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
to look at the new patch set (#3).
Change subject: Implement multiline responses for pkcs11-id commands
......................................................................
Implement multiline responses for pkcs11-id commands
Responses to the management interface commands pkcs11-id-[get|count] did not follow the standard syntax, but instead looked like notifications.
Introduce a new management interface version so that clients announcing versions >= 7 will receive responses in the new format while keeping compatibility for older client versions.
If a client announces a management version >= 7 the responses conform to the common multiline + END syntax. At the same time, it is now possible to query all PKCS#11 ids using "all" or a range from "start" to "end" - 1. Failures to retrieve an id will return a partial response terminated by an "ERROR" message including the erroneous index. The response format for pkcs11-id-get was changed to return a comma separated list (index,id,cert_blob) which is easier to parse.
---
M doc/management-notes.txt
M src/openvpn/manage.c
M src/openvpn/manage.h
3 files changed, 164 insertions(+), 21 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/48/2148/3
doc/management-notes.txt +89 -3
@@ -617,23 +617,109 @@ COMMAND -- pkcs11-id-count (OpenVPN 2.1 or higher) --------------------------------------------------- -Retrieve available number of certificates. +Retrieve available number of PKCS#11 certificates. + +For management client versions <7: + + pkcs11-id-count + +The reply is ">PKCS11ID-COUNT:<count>". Example: pkcs11-id-count >PKCS11ID-COUNT:5 +For management client versions >= 7: + + pkcs11-id-count + +The reply is a decimal count followed by "END" on a separate line. + +Example: + + pkcs11-id-count + 5 + END + COMMAND -- pkcs11-id-get (OpenVPN 2.1 or higher) ------------------------------------------------- +Retrieve PKCS#11 certificates. + +For management client versions < 7: + + pkcs11-id-get <index> + Retrieve certificate by index, the ID string should be provided as PKCS#11 identity, the blob is a base 64 encoded certificate. Example: pkcs11-id-get 1 - PKCS11ID-ENTRY:'1', ID:'<snip>', BLOB:'<snip>' + >PKCS11ID-ENTRY:'1', ID:'<id>', BLOB:'<blob>' + +For management client versions >= 7: + + pkcs11-id-get <index> + pkcs11-id-get <start> <end> + pkcs11-id-get all + +Retrieve a single PKCS#11 certificate at index <index> or multiple +PKCS#11 certificates from index <start> to <end>-1. Alternatively +<start> = "all" retrieves all PKCS#11 certificates. A comma separated +list including index, PKCS#11 id and the base 64 encoded certificate +will be returned. If any id retrieval results in a failure, the returned +list will be partial and terminated by "ERROR: .." instead of "END". +The "ERROR" message will include the index of failure. + +Example 1: + + Management interface client sends: + + pkcs11-id-get 1 + + OpenVPN daemon responds with: + + 1,<id>,<blob> + END + +Example 2: + + Management interface client sends: + + pkcs11-id-get 1 3 + + OpenVPN daemon responds with: + + 1,<id_a>,<blob_a> + 2,<id_b>,<blob_b> + END + +Example 3: + + Management interface client sends: + + pkcs11-id-get all + + OpenVPN daemon with 3 PKCS#11 certificates responds with: + + 0,<id_a>,<blob_a> + 1,<id_b>,<blob_b> + 2,<id_c>,<blob_c> + END + +Example 4: + + Management interface client sends: + + pkcs11-id-get all + + OpenVPN daemon with 3 PKCS#11 certificates fails to retrieve index 1 + + 0,<id_a>,<blob_a> + ERROR: Failed to load PKCS#11 id at index: 1 + COMMAND -- client-auth (OpenVPN 2.1 or higher) -----------------------------------------------
@@ -1240,7 +1326,7 @@ "ERROR: [text]". (2) For commands which print multiple lines of output, - the last line will be "END". + the last line will be "END" or "ERROR: [text]". (3) Real-time messages will be in the form ">[source]:[text]", where source is "CLIENT", "ECHO", "FATAL", "HOLD", "INFO", "LOG",
src/openvpn/manage.c +74 -17
122 lines not on this page · raw message
src/openvpn/manage.h +1 -1
@@ -50,7 +50,7 @@#include "socket_util.h" #include "mroute.h" -#define MANAGEMENT_VERSION 6 +#define MANAGEMENT_VERSION 7#define MANAGEMENT_N_PASSWORD_RETRIES 3#define MANAGEMENT_LOG_HISTORY_INITIAL_SIZE 100#define MANAGEMENT_ECHO_BUFFER_SIZE 100
--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 3
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: Frank Lichtenheld <[email protected]>
Gerrit-CC: Gert Doering <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: [email protected]
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Attention: Frank Lichtenheld <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Attention is currently required from: Arne Schwabe, Frank Lichtenheld, [email protected].
Hello Arne Schwabe, Selva Nair,
I'd like you to reexamine a change. Please visit
https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
to look at the new patch set (#4).
Change subject: Implement multiline responses for pkcs11-id commands
......................................................................
Implement multiline responses for pkcs11-id commands
Responses to the management interface commands pkcs11-id-[get|count] did not follow the standard syntax, but instead looked like notifications.
Introduce a new management interface version so that clients announcing versions >= 7 will receive responses in the new format while keeping compatibility for older client versions.
If a client announces a management version >= 7 the responses conform to the common multiline + END syntax. At the same time, it is now possible to query all PKCS#11 ids using "all" or a range from "start" to "end" - 1. Failures to retrieve an id will return a partial response terminated by an "ERROR" message including the erroneous index. The response format for pkcs11-id-get was changed to return a comma separated list (index,id,cert_blob) which is easier to parse.
---
M doc/management-notes.txt
M src/openvpn/manage.c
M src/openvpn/manage.h
3 files changed, 164 insertions(+), 21 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/48/2148/4
doc/management-notes.txt +89 -3
@@ -617,23 +617,109 @@ COMMAND -- pkcs11-id-count (OpenVPN 2.1 or higher) --------------------------------------------------- -Retrieve available number of certificates. +Retrieve available number of PKCS#11 certificates. + +For management client versions <7: + + pkcs11-id-count + +The reply is ">PKCS11ID-COUNT:<count>". Example: pkcs11-id-count >PKCS11ID-COUNT:5 +For management client versions >= 7: + + pkcs11-id-count + +The reply is a decimal count followed by "END" on a separate line. + +Example: + + pkcs11-id-count + 5 + END + COMMAND -- pkcs11-id-get (OpenVPN 2.1 or higher) ------------------------------------------------- +Retrieve PKCS#11 certificates. + +For management client versions < 7: + + pkcs11-id-get <index> + Retrieve certificate by index, the ID string should be provided as PKCS#11 identity, the blob is a base 64 encoded certificate. Example: pkcs11-id-get 1 - PKCS11ID-ENTRY:'1', ID:'<snip>', BLOB:'<snip>' + >PKCS11ID-ENTRY:'1', ID:'<id>', BLOB:'<blob>' + +For management client versions >= 7: + + pkcs11-id-get <index> + pkcs11-id-get <start> <end> + pkcs11-id-get all + +Retrieve a single PKCS#11 certificate at index <index> or multiple +PKCS#11 certificates from index <start> to <end>-1. Alternatively +<start> = "all" retrieves all PKCS#11 certificates. A comma separated +list including index, PKCS#11 id and the base 64 encoded certificate +will be returned. If any id retrieval results in a failure, the returned +list will be partial and terminated by "ERROR: .." instead of "END". +The "ERROR" message will include the index of failure. + +Example 1: + + Management interface client sends: + + pkcs11-id-get 1 + + OpenVPN daemon responds with: + + 1,<id>,<blob> + END + +Example 2: + + Management interface client sends: + + pkcs11-id-get 1 3 + + OpenVPN daemon responds with: + + 1,<id_a>,<blob_a> + 2,<id_b>,<blob_b> + END + +Example 3: + + Management interface client sends: + + pkcs11-id-get all + + OpenVPN daemon with 3 PKCS#11 certificates responds with: + + 0,<id_a>,<blob_a> + 1,<id_b>,<blob_b> + 2,<id_c>,<blob_c> + END + +Example 4: + + Management interface client sends: + + pkcs11-id-get all + + OpenVPN daemon with 3 PKCS#11 certificates fails to retrieve index 1 + + 0,<id_a>,<blob_a> + ERROR: Failed to load PKCS#11 id at index: 1 + COMMAND -- client-auth (OpenVPN 2.1 or higher) -----------------------------------------------
@@ -1240,7 +1326,7 @@ "ERROR: [text]". (2) For commands which print multiple lines of output, - the last line will be "END". + the last line will be "END" or "ERROR: [text]". (3) Real-time messages will be in the form ">[source]:[text]", where source is "CLIENT", "ECHO", "FATAL", "HOLD", "INFO", "LOG",
src/openvpn/manage.c +74 -17
122 lines not on this page · raw message
src/openvpn/manage.h +1 -1
@@ -50,7 +50,7 @@#include "socket_util.h" #include "mroute.h" -#define MANAGEMENT_VERSION 6 +#define MANAGEMENT_VERSION 7#define MANAGEMENT_N_PASSWORD_RETRIES 3#define MANAGEMENT_LOG_HISTORY_INITIAL_SIZE 100#define MANAGEMENT_ECHO_BUFFER_SIZE 100
--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 4
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: Frank Lichtenheld <[email protected]>
Gerrit-CC: Gert Doering <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: [email protected]
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Attention: Frank Lichtenheld <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Attention is currently required from: Arne Schwabe, Frank Lichtenheld, [email protected].
Yuriy Darnobyt has posted comments on this change by [email protected]. ( https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email )
Change subject: Implement multiline responses for pkcs11-id commands
......................................................................
Patch Set 4:
(1 comment)
Patchset:
PS2:
Quoted 1 line
Tried with a fresh clone of gerrit and the tree error is gone, but: […]
@[email protected] I did some permission changes when migrating to GitHub OAuth. And indeed I didn't add you into one of groups. Added now. Please try again.
--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 4
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: Frank Lichtenheld <[email protected]>
Gerrit-CC: Gert Doering <[email protected]>
Gerrit-CC: Yuriy Darnobyt <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: [email protected]
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Attention: Frank Lichtenheld <[email protected]>
Gerrit-Comment-Date: Mon, 09 Nov 2026 08:27:23 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Selva Nair <[email protected]>
Comment-In-Reply-To: Gert Doering <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Attention is currently required from: Arne Schwabe, Frank Lichtenheld, Gert Doering, Yuriy Darnobyt, [email protected].
Selva Nair has posted comments on this change by [email protected]. ( https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email )
Change subject: Implement multiline responses for pkcs11-id commands
......................................................................
Patch Set 5:
(1 comment)
Patchset:
PS2:
Quoted 1 line
@[email protected] I did some permission changes when migrating to GitHub OAuth. […]
Done
--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 5
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: Frank Lichtenheld <[email protected]>
Gerrit-CC: Gert Doering <[email protected]>
Gerrit-CC: Yuriy Darnobyt <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: [email protected]
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Attention: Gert Doering <[email protected]>
Gerrit-Attention: Frank Lichtenheld <[email protected]>
Gerrit-Attention: Yuriy Darnobyt <[email protected]>
Gerrit-Comment-Date: Mon, 09 Nov 2026 15:22:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Selva Nair <[email protected]>
Comment-In-Reply-To: Gert Doering <[email protected]>
Comment-In-Reply-To: Yuriy Darnobyt <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Attention is currently required from: Arne Schwabe, Frank Lichtenheld, Gert Doering, Yuriy Darnobyt, [email protected].
Selva Nair has posted comments on this change by [email protected]. ( https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email )
Change subject: Implement multiline responses for pkcs11-id commands
......................................................................
Patch Set 5: Code-Review+2
--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 5
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: Frank Lichtenheld <[email protected]>
Gerrit-CC: Gert Doering <[email protected]>
Gerrit-CC: Yuriy Darnobyt <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: [email protected]
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Attention: Gert Doering <[email protected]>
Gerrit-Attention: Frank Lichtenheld <[email protected]>
Gerrit-Attention: Yuriy Darnobyt <[email protected]>
Gerrit-Comment-Date: Mon, 09 Nov 2026 15:41:54 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
PATCH v5 1/1 Implement multiline responses for pkcs11-id commands
In reply to a message not in the archiveFrom: Marvin Wunderlich <[email protected]>
Responses to the management interface commands pkcs11-id-[get|count] did not follow the standard syntax, but instead looked like notifications.
Introduce a new management interface version so that clients announcing versions >= 7 will receive responses in the new format while keeping compatibility for older client versions.
If a client announces a management version >= 7 the responses conform to the common multiline + END syntax. At the same time, it is now possible to query all PKCS#11 ids using "all" or a range from "start" to "end" - 1. Failures to retrieve an id will return a partial response terminated by an "ERROR" message including the erroneous index. The response format for pkcs11-id-get was changed to return a comma separated list (index,id,cert_blob) which is easier to parse.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2148
---
This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2148
This mail reflects revision 5 of this Change.
Acked-by according to Gerrit (reflected above):
Selva Nair <[email protected]>
doc/management-notes.txt +89 -3
@@ -617,23 +617,109 @@ COMMAND -- pkcs11-id-count (OpenVPN 2.1 or higher) --------------------------------------------------- -Retrieve available number of certificates. +Retrieve available number of PKCS#11 certificates. + +For management client versions <7: + + pkcs11-id-count + +The reply is ">PKCS11ID-COUNT:<count>". Example: pkcs11-id-count >PKCS11ID-COUNT:5 +For management client versions >= 7: + + pkcs11-id-count + +The reply is a decimal count followed by "END" on a separate line. + +Example: + + pkcs11-id-count + 5 + END + COMMAND -- pkcs11-id-get (OpenVPN 2.1 or higher) ------------------------------------------------- +Retrieve PKCS#11 certificates. + +For management client versions < 7: + + pkcs11-id-get <index> + Retrieve certificate by index, the ID string should be provided as PKCS#11 identity, the blob is a base 64 encoded certificate. Example: pkcs11-id-get 1 - PKCS11ID-ENTRY:'1', ID:'<snip>', BLOB:'<snip>' + >PKCS11ID-ENTRY:'1', ID:'<id>', BLOB:'<blob>' + +For management client versions >= 7: + + pkcs11-id-get <index> + pkcs11-id-get <start> <end> + pkcs11-id-get all + +Retrieve a single PKCS#11 certificate at index <index> or multiple +PKCS#11 certificates from index <start> to <end>-1. Alternatively +<start> = "all" retrieves all PKCS#11 certificates. A comma separated +list including index, PKCS#11 id and the base 64 encoded certificate +will be returned. If any id retrieval results in a failure, the returned +list will be partial and terminated by "ERROR: .." instead of "END". +The "ERROR" message will include the index of failure. + +Example 1: + + Management interface client sends: + + pkcs11-id-get 1 + + OpenVPN daemon responds with: + + 1,<id>,<blob> + END + +Example 2: + + Management interface client sends: + + pkcs11-id-get 1 3 + + OpenVPN daemon responds with: + + 1,<id_a>,<blob_a> + 2,<id_b>,<blob_b> + END + +Example 3: + + Management interface client sends: + + pkcs11-id-get all + + OpenVPN daemon with 3 PKCS#11 certificates responds with: + + 0,<id_a>,<blob_a> + 1,<id_b>,<blob_b> + 2,<id_c>,<blob_c> + END + +Example 4: + + Management interface client sends: + + pkcs11-id-get all + + OpenVPN daemon with 3 PKCS#11 certificates fails to retrieve index 1 + + 0,<id_a>,<blob_a> + ERROR: Failed to load PKCS#11 id at index: 1 + COMMAND -- client-auth (OpenVPN 2.1 or higher) -----------------------------------------------
@@ -1240,7 +1326,7 @@ "ERROR: [text]". (2) For commands which print multiple lines of output, - the last line will be "END". + the last line will be "END" or "ERROR: [text]". (3) Real-time messages will be in the form ">[source]:[text]", where source is "CLIENT", "ECHO", "FATAL", "HOLD", "INFO", "LOG",
src/openvpn/manage.c +74 -17
122 lines not on this page · raw message
src/openvpn/manage.h +1 -1
@@ -50,7 +50,7 @@#include "socket_util.h" #include "mroute.h" -#define MANAGEMENT_VERSION 6 +#define MANAGEMENT_VERSION 7#define MANAGEMENT_N_PASSWORD_RETRIES 3#define MANAGEMENT_LOG_HISTORY_INITIAL_SIZE 100#define MANAGEMENT_ECHO_BUFFER_SIZE 100
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Attention is currently required from: Arne Schwabe, Frank Lichtenheld, Gert Doering, Yuriy Darnobyt, [email protected].
Hello Arne Schwabe, Selva Nair,
I'd like you to reexamine a change. Please visit
https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
to look at the new patch set (#6).
The change is no longer submittable: checks~ChecksSubmitRule is unsatisfied now.
Change subject: Implement multiline responses for pkcs11-id commands
......................................................................
Implement multiline responses for pkcs11-id commands
Responses to the management interface commands pkcs11-id-[get|count] did not follow the standard syntax, but instead looked like notifications.
Introduce a new management interface version so that clients announcing versions >= 7 will receive responses in the new format while keeping compatibility for older client versions.
If a client announces a management version >= 7 the responses conform to the common multiline + END syntax. At the same time, it is now possible to query all PKCS#11 ids using "all" or a range from "start" to "end" - 1. Failures to retrieve an id will return a partial response terminated by an "ERROR" message including the erroneous index. The response format for pkcs11-id-get was changed to return a comma separated list (index,id,cert_blob) which is easier to parse.
---
M doc/management-notes.txt
M src/openvpn/manage.c
M src/openvpn/manage.h
3 files changed, 164 insertions(+), 21 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/48/2148/6
doc/management-notes.txt +89 -3
@@ -617,23 +617,109 @@ COMMAND -- pkcs11-id-count (OpenVPN 2.1 or higher) --------------------------------------------------- -Retrieve available number of certificates. +Retrieve available number of PKCS#11 certificates. + +For management client versions <7: + + pkcs11-id-count + +The reply is ">PKCS11ID-COUNT:<count>". Example: pkcs11-id-count >PKCS11ID-COUNT:5 +For management client versions >= 7: + + pkcs11-id-count + +The reply is a decimal count followed by "END" on a separate line. + +Example: + + pkcs11-id-count + 5 + END + COMMAND -- pkcs11-id-get (OpenVPN 2.1 or higher) ------------------------------------------------- +Retrieve PKCS#11 certificates. + +For management client versions < 7: + + pkcs11-id-get <index> + Retrieve certificate by index, the ID string should be provided as PKCS#11 identity, the blob is a base 64 encoded certificate. Example: pkcs11-id-get 1 - PKCS11ID-ENTRY:'1', ID:'<snip>', BLOB:'<snip>' + >PKCS11ID-ENTRY:'1', ID:'<id>', BLOB:'<blob>' + +For management client versions >= 7: + + pkcs11-id-get <index> + pkcs11-id-get <start> <end> + pkcs11-id-get all + +Retrieve a single PKCS#11 certificate at index <index> or multiple +PKCS#11 certificates from index <start> to <end>-1. Alternatively +<start> = "all" retrieves all PKCS#11 certificates. A comma separated +list including index, PKCS#11 id and the base 64 encoded certificate +will be returned. If any id retrieval results in a failure, the returned +list will be partial and terminated by "ERROR: .." instead of "END". +The "ERROR" message will include the index of failure. + +Example 1: + + Management interface client sends: + + pkcs11-id-get 1 + + OpenVPN daemon responds with: + + 1,<id>,<blob> + END + +Example 2: + + Management interface client sends: + + pkcs11-id-get 1 3 + + OpenVPN daemon responds with: + + 1,<id_a>,<blob_a> + 2,<id_b>,<blob_b> + END + +Example 3: + + Management interface client sends: + + pkcs11-id-get all + + OpenVPN daemon with 3 PKCS#11 certificates responds with: + + 0,<id_a>,<blob_a> + 1,<id_b>,<blob_b> + 2,<id_c>,<blob_c> + END + +Example 4: + + Management interface client sends: + + pkcs11-id-get all + + OpenVPN daemon with 3 PKCS#11 certificates fails to retrieve index 1 + + 0,<id_a>,<blob_a> + ERROR: Failed to load PKCS#11 id at index: 1 + COMMAND -- client-auth (OpenVPN 2.1 or higher) -----------------------------------------------
@@ -1240,7 +1326,7 @@ "ERROR: [text]". (2) For commands which print multiple lines of output, - the last line will be "END". + the last line will be "END" or "ERROR: [text]". (3) Real-time messages will be in the form ">[source]:[text]", where source is "CLIENT", "ECHO", "FATAL", "HOLD", "INFO", "LOG",
src/openvpn/manage.c +74 -17
122 lines not on this page · raw message
src/openvpn/manage.h +1 -1
@@ -50,7 +50,7 @@#include "socket_util.h" #include "mroute.h" -#define MANAGEMENT_VERSION 6 +#define MANAGEMENT_VERSION 7#define MANAGEMENT_N_PASSWORD_RETRIES 3#define MANAGEMENT_LOG_HISTORY_INITIAL_SIZE 100#define MANAGEMENT_ECHO_BUFFER_SIZE 100
--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 6
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: Frank Lichtenheld <[email protected]>
Gerrit-CC: Gert Doering <[email protected]>
Gerrit-CC: Yuriy Darnobyt <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: [email protected]
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Attention: Gert Doering <[email protected]>
Gerrit-Attention: Frank Lichtenheld <[email protected]>
Gerrit-Attention: Yuriy Darnobyt <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Attention is currently required from: Arne Schwabe, Frank Lichtenheld, Gert Doering, Yuriy Darnobyt.
[email protected] has posted comments on this change by [email protected]. ( https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email )
Change subject: Implement multiline responses for pkcs11-id commands
......................................................................
Patch Set 6:
(1 comment)
Patchset:
PS6:
Sorry @[email protected] I had to push again, @[email protected]'s keen eyes spotted a typo in my author mail address.
--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 6
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: Frank Lichtenheld <[email protected]>
Gerrit-CC: Gert Doering <[email protected]>
Gerrit-CC: Yuriy Darnobyt <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Attention: Gert Doering <[email protected]>
Gerrit-Attention: Frank Lichtenheld <[email protected]>
Gerrit-Attention: Yuriy Darnobyt <[email protected]>
Gerrit-Comment-Date: Mon, 09 Nov 2026 18:12:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Attention is currently required from: Arne Schwabe, Frank Lichtenheld, Gert Doering, Yuriy Darnobyt, [email protected].
Selva Nair has posted comments on this change by [email protected]. ( https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email )
Change subject: Implement multiline responses for pkcs11-id commands
......................................................................
Patch Set 6: Code-Review+2
(1 comment)
Patchset:
PS6:
Quoted 1 line
Sorry @[email protected] I had to push again, @[email protected]. […]
Not sure this was needed, but repushed to make this ready again.
--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2148?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09e55085cde6dbc0040e111a42128527d59832b8
Gerrit-Change-Number: 2148
Gerrit-PatchSet: 6
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Selva Nair <[email protected]>
Gerrit-CC: Frank Lichtenheld <[email protected]>
Gerrit-CC: Gert Doering <[email protected]>
Gerrit-CC: Yuriy Darnobyt <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: [email protected]
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Attention: Gert Doering <[email protected]>
Gerrit-Attention: Frank Lichtenheld <[email protected]>
Gerrit-Attention: Yuriy Darnobyt <[email protected]>
Gerrit-Comment-Date: Sat, 14 Nov 2026 16:50:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: [email protected]
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
PATCH v7 1/1 Implement multiline responses for pkcs11-id commands
In reply to a message not in the archiveFrom: Marvin Wunderlich <[email protected]>
Responses to the management interface commands pkcs11-id-[get|count] did not follow the standard syntax, but instead looked like notifications.
Introduce a new management interface version so that clients announcing versions >= 7 will receive responses in the new format while keeping compatibility for older client versions.
If a client announces a management version >= 7 the responses conform to the common multiline + END syntax. At the same time, it is now possible to query all PKCS#11 ids using "all" or a range from "start" to "end" - 1. Failures to retrieve an id will return a partial response terminated by an "ERROR" message including the erroneous index. The response format for pkcs11-id-get was changed to return a comma separated list (index,id,cert_blob) which is easier to parse.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2148
---
This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2148
This mail reflects revision 7 of this Change.
Acked-by according to Gerrit (reflected above):
Selva Nair <[email protected]>
doc/management-notes.txt +89 -3
@@ -617,23 +617,109 @@ COMMAND -- pkcs11-id-count (OpenVPN 2.1 or higher) --------------------------------------------------- -Retrieve available number of certificates. +Retrieve available number of PKCS#11 certificates. + +For management client versions <7: + + pkcs11-id-count + +The reply is ">PKCS11ID-COUNT:<count>". Example: pkcs11-id-count >PKCS11ID-COUNT:5 +For management client versions >= 7: + + pkcs11-id-count + +The reply is a decimal count followed by "END" on a separate line. + +Example: + + pkcs11-id-count + 5 + END + COMMAND -- pkcs11-id-get (OpenVPN 2.1 or higher) ------------------------------------------------- +Retrieve PKCS#11 certificates. + +For management client versions < 7: + + pkcs11-id-get <index> + Retrieve certificate by index, the ID string should be provided as PKCS#11 identity, the blob is a base 64 encoded certificate. Example: pkcs11-id-get 1 - PKCS11ID-ENTRY:'1', ID:'<snip>', BLOB:'<snip>' + >PKCS11ID-ENTRY:'1', ID:'<id>', BLOB:'<blob>' + +For management client versions >= 7: + + pkcs11-id-get <index> + pkcs11-id-get <start> <end> + pkcs11-id-get all + +Retrieve a single PKCS#11 certificate at index <index> or multiple +PKCS#11 certificates from index <start> to <end>-1. Alternatively +<start> = "all" retrieves all PKCS#11 certificates. A comma separated +list including index, PKCS#11 id and the base 64 encoded certificate +will be returned. If any id retrieval results in a failure, the returned +list will be partial and terminated by "ERROR: .." instead of "END". +The "ERROR" message will include the index of failure. + +Example 1: + + Management interface client sends: + + pkcs11-id-get 1 + + OpenVPN daemon responds with: + + 1,<id>,<blob> + END + +Example 2: + + Management interface client sends: + + pkcs11-id-get 1 3 + + OpenVPN daemon responds with: + + 1,<id_a>,<blob_a> + 2,<id_b>,<blob_b> + END + +Example 3: + + Management interface client sends: + + pkcs11-id-get all + + OpenVPN daemon with 3 PKCS#11 certificates responds with: + + 0,<id_a>,<blob_a> + 1,<id_b>,<blob_b> + 2,<id_c>,<blob_c> + END + +Example 4: + + Management interface client sends: + + pkcs11-id-get all + + OpenVPN daemon with 3 PKCS#11 certificates fails to retrieve index 1 + + 0,<id_a>,<blob_a> + ERROR: Failed to load PKCS#11 id at index: 1 + COMMAND -- client-auth (OpenVPN 2.1 or higher) -----------------------------------------------
@@ -1240,7 +1326,7 @@ "ERROR: [text]". (2) For commands which print multiple lines of output, - the last line will be "END". + the last line will be "END" or "ERROR: [text]". (3) Real-time messages will be in the form ">[source]:[text]", where source is "CLIENT", "ECHO", "FATAL", "HOLD", "INFO", "LOG",
src/openvpn/manage.c +74 -17
122 lines not on this page · raw message
src/openvpn/manage.h +1 -1
@@ -50,7 +50,7 @@#include "socket_util.h" #include "mroute.h" -#define MANAGEMENT_VERSION 6 +#define MANAGEMENT_VERSION 7#define MANAGEMENT_N_PASSWORD_RETRIES 3#define MANAGEMENT_LOG_HISTORY_INITIAL_SIZE 100#define MANAGEMENT_ECHO_BUFFER_SIZE 100
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel